struct ClnReadBalanceArgs_t
	{
	/* ID of the customer whose balance is being read */
	char cusId<>;
	
	/* the expected UpdateCount at the server after an instruction is preformed */
	int expectedUpdateCount;
	};

struct ClnWdDpArgs_t
	{
	/* ID of the customer whose balance is being read */
	char cusId<>;
	/* amount of money to be withdrawn or deposited */
	double amount;
	
	/* the expected UpdateCount at the server after an instruction is preformed */
	int expectedUpdateCount;
	};
	
struct ClnTransferArgs_t
	{
	/* money is debited from this customer */
	char fromCusId<>;
	/* money is credited into this customer */
	char toCusId<>;
	/* the amount of money being trasferred */
	double amount;
	
	/* the expected UpdateCount at the server after an instruction is preformed */
	int expectedUpdateCount;
	};
	
struct SyncTwoBalanceArgs_t
	{
	/* ID of the customer-1 */
	char cusId1<>;
	/* the new balance for the customer-1 */
	double balance1;
	/* ID of the cusotmer-2 */
	char cusId2<>;
	/* the new balance for the cusotmer-2 */
	double balance2;
	/* the UpdateCount of the primary server */
	int expectedUpdateCount;
	};
	
struct ActionRet_t
	{
	/* 0 = ok; 1 = error */
	bool status;
	/* status description after an action is executed */
	char statusMsg<>;
	/* the current UpdateCount at server */
	int serverUpdateCount;
	};

program SyncAgent
	{
	version SyncAgentVer
		{
		/*************/
		/* ClientRPC */
		/*************/
		
		ActionRet_t ClnWithdrawal (ClnWdDpArgs_t) = 1;
		ActionRet_t ClnDeposit (ClnWdDpArgs_t) = 2;
		ActionRet_t ClnTransfer (ClnTransferArgs_t) = 3;
		ActionRet_t ClnReadBalance (ClnReadBalanceArgs_t) = 4;
		ActionRet_t ClnCreateClient (ClnReadBalanceArgs_t) = 7;
		
		/***********/
		/* SyncRPC */
		/***********/
		
		/* set the balance of two customers atomically
		 * at the secondary server */
		ActionRet_t SyncTwoBalance (SyncTwoBalanceArgs_t) = 5;
		/* Request the remote server to initiate sync operation */
		ActionRet_t SyncMe (void) = 6;
		}=1;
	}=50419704;